package com.chapter.Demo04;

public class Outer {
    private String name="xu";
    private int age =22;
    public void show(){
        //定义局部变量
         String address ="上饶";
        //局部内部类;注意不能加任何访问修饰符
        //局部内部类与局部变量级别相同
        class Inner{
            //局部内部类属性
            private String phone ="1234";
            private String email ="0987";
            public void show2(){
                //访问外部类的属性
                System.out.println(Outer.this.name);
                System.out.println(Outer.this.age);
                //访问内部类属性
                System.out.println(this.email);
                System.out.println(this.phone);
                //如何访问局部变量,jdk1.7  要求必须是常量；jdk1.8  自动添加final
                System.out.println(address);

            }

        }
        //创建局部内部类对象
        Inner inner =new Inner();
        inner.show2();
    }

}
